#define HALGLOBAL_HEAD

#include <halglobal.h>

HAL_DEFGLOBAL_VARIABLE (mach_t, osmachine);
HAL_DEFGLOBAL_VARIABLE (phymem_t, osphymem);
HAL_DEFGLOBAL_VARIABLE (intsrcdsc_t, osintsrcdsc)[IRQ_SRC_MAX];

/* 内存地址映射图 */
HAL_DEFGLOBAL_VARIABLE (phyaddrspce_t, osmachineaddrspace)[PLFM_ADDRSPACE_NBR] = 
    {

    /* 地址空间类型 | 设备类型 | 开始地址 | 结束地址 */
    
    {ADDRSPACE_NORFLASH, 0, 0,          0x001FFFFF},
    {ADDRSPACE_IO,       0, 0x08000000, 0x0800000f},
    {ADDRSPACE_IO,       0, 0x10000000, 0x1000000f},
    {ADDRSPACE_IO,       0, 0x19000000, 0x190fffff},
    {ADDRSPACE_IO,       0, 0x20000000, 0x2000000f},
    {ADDRSPACE_IO,       0, 0x28000000, 0x28000007},
    {ADDRSPACE_IO,       0, 0x29000000, 0x29000007},
    {ADDRSPACE_SDRAM,    0, 0x30000000, 0x33ffffff}, /* 64MB SDRAM */
    {ADDRSPACE_IO,       0, 0x48000000, 0x48000030}, /* Memory Controllers */
    {ADDRSPACE_IO,       0, 0x49000000, 0x49000058}, /* USB Host Controller */
    {ADDRSPACE_IO,       0, 0x4a000000, 0x4a00001c}, /* Interrupt Controller */
    {ADDRSPACE_IO,       0, 0x4b000000, 0x4b0000e0}, /* DMA */
    {ADDRSPACE_IO,       0, 0x4c000000, 0x4c000018}, /* Clock & Power Management */
    {ADDRSPACE_IO,       0, 0x4d000000, 0x4d000060}, /* LCD Controller */
    {ADDRSPACE_IO,       0, 0x4e000000, 0x4e00003c}, /* NAND Flash */
    {ADDRSPACE_IO,       0, 0x4f000000, 0x4f0000a0}, /* Camera Interface */
    {ADDRSPACE_IO,       0, 0x50000000, 0x50008028}, /* UART */
    {ADDRSPACE_IO,       0, 0x51000000, 0x51000040}, /* PWM Timer */
    {ADDRSPACE_IO,       0, 0x52000000, 0x5200026f}, /* USB Device */
    {ADDRSPACE_IO,       0, 0x53000000, 0x53000008}, /* Watchdog Timer */
    {ADDRSPACE_IO,       0, 0x54000000, 0x54000010}, /* IIC */
    {ADDRSPACE_IO,       0, 0x55000000, 0x55000012}, /* IIS */
    {ADDRSPACE_IO,       0, 0x56000000, 0x560000cc}, /* I/O port */
    {ADDRSPACE_IO,       0, 0x57000040, 0x5700008b}, /* RTC */
    {ADDRSPACE_IO,       0, 0x58000000, 0x58000014}, /* A/D Converter */
    {ADDRSPACE_IO,       0, 0x59000000, 0x59000034}, /* SPI */
    {ADDRSPACE_IO,       0, 0x5a000000, 0x5a000043}, /* SD Interface */
    {ADDRSPACE_IO,       0, 0x5b000000, 0x5b00001c}, /* AC97 Audio-CODEC Interface */
    {ADDRSPACE_NOT, DEV_TYPE_NOT, 0,    0}           /* END mark */
    };
